<?php
/*
 * Created on Oct 29, 2009
 * Author: Ramesh Sakibanda
 */
?>
<?php
	$liList = '';
	$index = 0;
	foreach($images as $image){
		if($index == 0){
			$liList .= "<li class='active' id='li$index'>".$html->tag('img', null, array('src' => $image, 'id' => 'img'.$index))."</li>";
		}else{
				$liList .= "<li id='li$index'>".$html->tag('img', null, array('src' => $image, 'id' => 'img'.$index))."</li>";
		}

		$index++;
	}
	echo $html->div('demo', $html->div(null, '', array('id' => 'main_image')).$html->tag('ul', $liList, array('class' => 'gallery')));
	echo $html->div('prvw', "<img class='preview'/>preview", array('id' => 'prvw'));
	echo "<div class='cropform'>";
	echo $form->create('Images', array('action' => 'crop'));
	$index = 0;
	foreach($images as $image){
		echo $form->hidden('Ratio'.$index, array('name' => 'Ratio'.$index, 'value' => $ratios[$index]));

		echo $form->hidden('X'.$index, array('name' => 'X'.$index));
		echo $form->hidden('Y'.$index, array('name' => 'Y'.$index));
		echo $form->hidden('X2'.$index, array('name' => 'X2'.$index));
		echo $form->hidden('Y2'.$index, array('name' => 'Y2'.$index));
		echo $form->hidden('W'.$index, array('name' => 'W'.$index));
		echo $form->hidden('H'.$index, array('name' => 'H'.$index));
		$index++;
	}
	echo $html->link('crop', '#', array('onclick' => 'document.forms[0].submit()', 'class' => 'magenta small awesome'));
	echo $form->end();
	echo "</div>";
?>
